package managers;

import java.sql.SQLException;
import java.util.Vector;

import business.Currency;

public class MngCurrencies extends Manager {
	
	public MngCurrencies() {
		super();
	}
	
	public Vector<Currency> getCurrencies() {
		Vector<Currency> currencies = new Vector<Currency>();
		
		String sql = "SELECT * FROM currencies";
		
		try {
			rst = stmt.executeQuery(sql);
			
			while (rst.next()) {
				Currency currency = new Currency();
				currency.setId(rst.getInt("id"));
				currency.setCurrency(rst.getString("currency"));
				currency.setPrefix(rst.getString("prefix"));
				
				currencies.add(currency);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return currencies;
	}
}